<include file="public@header"/>
</head>
<body>
<div class="wrap">
    <form class="form-inline">
        <div class="form-group">
            <label for="epoch">房族名称</label>
            <input type="text" name="name" value="{$name?$name:''}" class="form-control" id="epoch" placeholder="房族名称">
        </div>
        <button type="submit" class="btn btn-default">搜索</button>
    </form>
</div>
<div class="wrap">
    <table class="table">
        <thead>
            <tr>
                <th>id</th>
                <th>深度</th>
                <th>名称</th>
                <th>创建时间</th>
                <th>修改时间</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
        <foreach name="list" item="vo">
            <tr>
                <td>{$vo.id}</td>
                <td>
                    <for start="0" end="$vo.level">
                        <span>|-</span>
                    </for>
                </td>
                <td>{$vo.name}</td>
                <td>{:date('Y-m-d H:i"s',$vo.create_time)}</td>
                <td>{:date('Y-m-d H:i"s',$vo.update_time)}</td>
                <td>
                    <a href="{:url('admin/clan/edit',['id'=>$vo.id])}">编辑</a>
                    <a href="{:url('admin/clan/view',['id'=>$vo.id])}">查看</a>
                    <a href="#" class="delete" data-toggle="modal" data-target="#modalDelete" data-id="{$vo.id}">删除</a>
                </td>
            </tr>
        </foreach>
        </tbody>
    </table>
</div>
<div class="modal fade" tabindex="-1" role="dialog" id="modalDelete" aria-labelledby="mySmallModalLabel">
    <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="gridSystemModalLabel">是否确定删除</h4>
            </div>
            <div class="modal-body">
                是否确定删除该成员？
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" id="delSubmit" data-id="">非常确定</button>
            </div>
        </div>
    </div>

</div>
<script>
    $(function(){
        $('.delete').click(function(){
            var id = $(this).attr('data-id');
            $('#delSubmit').attr('data-id',id);
        });
        $('#delSubmit').click(function(){
            var id = $(this).attr('data-id');
            location.href = '/admin/clan/delete/id/'+id;
        })
    });
</script>
</body>
</html>